package com.zhanbo.zhanbowymusic.main.featured.adapter;

import android.content.Context;
import android.text.TextUtils;

import com.mwx.baselib.base.BaseBindingAdapter;
import com.mwx.baselib.bean.SingerListBean;
import com.mwx.baselib.utils.GlideUtils;
import com.zhanbo.zhanbowymusic.R;
import com.zhanbo.zhanbowymusic.databinding.ItemSingerBinding;

public class SingerListAdapter extends BaseBindingAdapter<SingerListBean.ItemsDTO, ItemSingerBinding> {
    public SingerListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.item_singer;
    }

    @Override
    protected void onBindItem(ItemSingerBinding binding, SingerListBean.ItemsDTO item) {
//        GlideUtils.loadImage(context,"/upload/banner/109951169892379133.jpg", binding.ivHead);
        GlideUtils.loadImage(context, item.getCoverImg(), binding.ivHead);
        binding.tvSingerName.setText(!TextUtils.isEmpty(item.getName()) ? item.getName() : "");
        binding.tvSingerSingNum.setText(!TextUtils.isEmpty(item.getId()+"") ? "单曲：" + item.getSong().size() : "");
    }


}
